﻿using System;
using System.Collections;
using System.Configuration;
using System.Data;
using System.Linq;
using System.Web;
using System.Web.Security;
using System.Web.UI;
using System.Web.UI.WebControls;
using System.Web.UI.WebControls.WebParts;
using System.Web.UI.HtmlControls;
using System.Xml.Linq;

namespace LMIS_Application
{
    public partial class EditBookInstance : System.Web.UI.Page
    {
        protected void Page_Load(object sender, EventArgs e)
        {

        }

        protected void btnFillBookInfo_Click(object sender, EventArgs e)
        {
            Inv i = new Inv();
            i.loadInventory(Convert.ToInt32(tbBookCopyID.Text));

            tbBookId.Text = i.BookId.ToString();
            tbStatus.Text = i.Status.ToString();
        }

        protected void btnEditBook_Click(object sender, EventArgs e)
        {
            Inv i = new Inv();
            bool outcome = i.editBookCopy(Convert.ToInt32(tbBookCopyID.Text), Convert.ToInt32(tbStatus.Text), Convert.ToInt32(tbBookId.Text));

            if (outcome)
            {
                info.Text = "Book copy Updated!";
            }
            else
            {
                info.Text = "Book copy was not updated";
            }
        }
    }
}
